<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" href="lib.css" type='text/css' />
<link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" />
<link rel='start' href='../index.html' title='Python documentation Index' />
<link rel="first" href="lib.html" title='Python library Reference' />
<link rel='contents' href='contents.html' title="Contents" />
<link rel='index' href='genindex.html' title='Index' />
<link rel='last' href='about.html' title='About this document...' />
<link rel='help' href='about.html' title='About this document...' />
<link rel="next" href="module-collections.html" />
<link rel="prev" href="module-datetime.html" />
<link rel="parent" href="datatypes.html" />
<link rel="next" href="module-collections.html" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name='aesop' content='information' />
<title>5.2 calendar -- General calendar-related functions</title>
</head>
<body>
<div class="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="5.1.7 strftime() Behavior"
  href="strftime-behavior.html"><img src='../icons/previous.png'
  border='0' height='32'  alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="5. data Types"
  href="datatypes.html"><img src='../icons/up.png'
  border='0' height='32'  alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="5.3 collections  "
  href="module-collections.html"><img src='../icons/next.png'
  border='0' height='32'  alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
  href="contents.html"><img src='../icons/contents.png'
  border='0' height='32'  alt='Contents' width='32' /></a></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
  border='0' height='32'  alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
  href="genindex.html"><img src='../icons/index.png'
  border='0' height='32'  alt='Index' width='32' /></a></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="strftime-behavior.html">5.1.7 strftime() Behavior</a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="datatypes.html">5. Data Types</a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="module-collections.html">5.3 collections  </a>
</div>
<hr /></div>
</div>
<!--End of Navigation Panel-->

<h1><a name="SECTION007200000000000000000">
5.2 <tt class="module">calendar</tt> --
         General calendar-related functions</a>
</h1>

<p>
<a name="module-calendar"></a>

<p>
This module allows you to output calendars like the <span class="Unix">Unix</span>
<b class="program">cal</b> program, and provides additional useful functions
related to the calendar. By default, these calendars have Monday as
the first day of the week, and Sunday as the last (the European
convention). Use <tt class="function">setfirstweekday()</tt> to set the first day of the
week to Sunday (6) or to any other weekday.  Parameters that specify
dates are given as integers.

<p>
Most of these functions and classses rely on the <tt class="module">datetime</tt>
module which uses an idealized calendar, the current Gregorian
calendar indefinitely extended in both directions.  This matches
the definition of the "proleptic Gregorian" calendar in Dershowitz
and Reingold's book "Calendrical Calculations", where it's the
base calendar for all computations.

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><span class="typelabel">class</span>&nbsp;<tt id='l2h-693' xml:id='l2h-693' class="class">Calendar</tt></b>(</nobr></td>
  <td><var></var><big>[</big><var>firstweekday</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Creates a <tt class="class">Calendar</tt> object. <var>firstweekday</var> is an integer
specifying the first day of the week. <code>0</code> is Monday (the default),
<code>6</code> is Sunday.

<p>
A <tt class="class">Calendar</tt> object provides several methods that can
be used for preparing the calendar data for formatting. This
class doesn't do any formatting itself. This is the job of
subclasses.

<span class="versionnote">New in version 2.5.</span>

</dl>

<p>
<tt class="class">Calendar</tt> instances have the following methods:

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-694' xml:id='l2h-694' class="method">iterweekdays</tt></b>(</nobr></td>
  <td><var>weekday</var>)</td></tr></table></dt>
<dd>
Return an iterator for the week day numbers that will be used
for one week. The first number from the iterator will be the
same as the number returned by <tt class="method">firstweekday()</tt>.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-695' xml:id='l2h-695' class="method">itermonthdates</tt></b>(</nobr></td>
  <td><var>year, month</var>)</td></tr></table></dt>
<dd>
Return an iterator for the month <var>month</var> (1-12) in the
year <var>year</var>. This iterator will return all days (as
<tt class="class">datetime.date</tt> objects) for the month and all days
before the start of the month or after the end of the month
that are required to get a complete week.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-696' xml:id='l2h-696' class="method">itermonthdays2</tt></b>(</nobr></td>
  <td><var>year, month</var>)</td></tr></table></dt>
<dd>
Return an iterator for the month <var>month</var> in the year
<var>year</var> similar to <tt class="method">itermonthdates()</tt>. Days returned
will be tuples consisting of a day number and a week day
number.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-697' xml:id='l2h-697' class="method">itermonthdays</tt></b>(</nobr></td>
  <td><var>year, month</var>)</td></tr></table></dt>
<dd>
Return an iterator for the month <var>month</var> in the year
<var>year</var> similar to <tt class="method">itermonthdates()</tt>. Days returned
will simply be day numbers.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-698' xml:id='l2h-698' class="method">monthdatescalendar</tt></b>(</nobr></td>
  <td><var>year, month</var>)</td></tr></table></dt>
<dd>
Return a list of the weeks in the month <var>month</var> of
the <var>year</var> as full weeks. Weeks are lists of seven
<tt class="class">datetime.date</tt> objects.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-699' xml:id='l2h-699' class="method">monthdays2calendar</tt></b>(</nobr></td>
  <td><var>year, month</var>)</td></tr></table></dt>
<dd>
Return a list of the weeks in the month <var>month</var> of
the <var>year</var> as full weeks. Weeks are lists of seven
tuples of day numbers and weekday numbers.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-700' xml:id='l2h-700' class="method">monthdayscalendar</tt></b>(</nobr></td>
  <td><var>year, month</var>)</td></tr></table></dt>
<dd>
Return a list of the weeks in the month <var>month</var> of
the <var>year</var> as full weeks. Weeks are lists of seven
day numbers.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-701' xml:id='l2h-701' class="method">yeardatescalendar</tt></b>(</nobr></td>
  <td><var>year, month</var><big>[</big><var>, width</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Return the data for the specified year ready for formatting. The return
value is a list of month rows. Each month row contains up to <var>width</var>
months (defaulting to 3). Each month contains between 4 and 6 weeks and
each week contains 1-7 days. Days are <tt class="class">datetime.date</tt> objects.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-702' xml:id='l2h-702' class="method">yeardays2calendar</tt></b>(</nobr></td>
  <td><var>year, month</var><big>[</big><var>, width</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Return the data for the specified year ready for formatting (similar to
<tt class="method">yeardatescalendar()</tt>). Entries in the week lists are tuples of
day numbers and weekday numbers. Day numbers outside this month are zero.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-703' xml:id='l2h-703' class="method">yeardayscalendar</tt></b>(</nobr></td>
  <td><var>year, month</var><big>[</big><var>, width</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Return the data for the specified year ready for formatting (similar to
<tt class="method">yeardatescalendar()</tt>). Entries in the week lists are day numbers.
Day numbers outside this month are zero.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><span class="typelabel">class</span>&nbsp;<tt id='l2h-704' xml:id='l2h-704' class="class">TextCalendar</tt></b>(</nobr></td>
  <td><var></var><big>[</big><var>firstweekday</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
This class can be used to generate plain text calendars.

<p>

<span class="versionnote">New in version 2.5.</span>

</dl>

<p>
<tt class="class">TextCalendar</tt> instances have the following methods:

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-705' xml:id='l2h-705' class="method">formatmonth</tt></b>(</nobr></td>
  <td><var>theyear, themonth</var><big>[</big><var>, w</var><big>[</big><var>, l</var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Return a month's calendar in a multi-line string. If <var>w</var> is
provided, it specifies the width of the date columns, which are
centered. If <var>l</var> is given, it specifies the number of lines that
each week will use. Depends on the first weekday as set by
<tt class="function">setfirstweekday()</tt>.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-706' xml:id='l2h-706' class="method">prmonth</tt></b>(</nobr></td>
  <td><var>theyear, themonth</var><big>[</big><var>, w</var><big>[</big><var>, l</var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Print a month's calendar as returned by <tt class="method">formatmonth()</tt>.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-707' xml:id='l2h-707' class="method">formatyear</tt></b>(</nobr></td>
  <td><var>theyear, themonth</var><big>[</big><var>, w</var><big>[</big><var>,
                               l</var><big>[</big><var>, c</var><big>[</big><var>, m</var><big>]</big><var></var><big>]</big><var></var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Return a <var>m</var>-column calendar for an entire year as a multi-line string.
Optional parameters <var>w</var>, <var>l</var>, and <var>c</var> are for date column
width, lines per week, and number of spaces between month columns,
respectively. Depends on the first weekday as set by
<tt class="method">setfirstweekday()</tt>.  The earliest year for which a calendar can
be generated is platform-dependent.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-708' xml:id='l2h-708' class="method">pryear</tt></b>(</nobr></td>
  <td><var>theyear</var><big>[</big><var>, w</var><big>[</big><var>, l</var><big>[</big><var>,
                           c</var><big>[</big><var>, m</var><big>]</big><var></var><big>]</big><var></var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Print the calendar for an entire year as returned by <tt class="method">formatyear()</tt>.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><span class="typelabel">class</span>&nbsp;<tt id='l2h-709' xml:id='l2h-709' class="class">HTMLCalendar</tt></b>(</nobr></td>
  <td><var></var><big>[</big><var>firstweekday</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
This class can be used to generate HTML calendars.

<p>

<span class="versionnote">New in version 2.5.</span>

</dl>

<p>
<tt class="class">HTMLCalendar</tt> instances have the following methods:

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-710' xml:id='l2h-710' class="method">formatmonth</tt></b>(</nobr></td>
  <td><var>theyear, themonth</var><big>[</big><var>, withyear</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Return a month's calendar as an HTML table. If <var>withyear</var> is
true the year will be included in the header, otherwise just the
month name will be used.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-711' xml:id='l2h-711' class="method">formatyear</tt></b>(</nobr></td>
  <td><var>theyear, themonth</var><big>[</big><var>, width</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Return a year's calendar as an HTML table. <var>width</var> (defaulting to 3)
specifies the number of months per row.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-712' xml:id='l2h-712' class="method">formatyearpage</tt></b>(</nobr></td>
  <td><var>theyear, themonth</var><big>[</big><var>,
                                   width</var><big>[</big><var>, css</var><big>[</big><var>, encoding</var><big>]</big><var></var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Return a year's calendar as a complete HTML page. <var>width</var>
(defaulting to 3) specifies the number of months per row. <var>css</var>
is the name for the cascading style sheet to be used. <tt class="constant">None</tt>
can be passed if no style sheet should be used. <var>encoding</var>
specifies the encoding to be used for the output (defaulting
to the system default encoding).
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><span class="typelabel">class</span>&nbsp;<tt id='l2h-713' xml:id='l2h-713' class="class">LocaleTextCalendar</tt></b>(</nobr></td>
  <td><var></var><big>[</big><var>firstweekday</var><big>[</big><var>, locale</var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
This subclass of <tt class="class">TextCalendar</tt> can be passed a locale name in the
constructor and will return month and weekday names in the specified locale.
If this locale includes an encoding all strings containing month and weekday
names will be returned as unicode.

<span class="versionnote">New in version 2.5.</span>

</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><span class="typelabel">class</span>&nbsp;<tt id='l2h-714' xml:id='l2h-714' class="class">LocaleHTMLCalendar</tt></b>(</nobr></td>
  <td><var></var><big>[</big><var>firstweekday</var><big>[</big><var>, locale</var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
This subclass of <tt class="class">HTMLCalendar</tt> can be passed a locale name in the
constructor and will return month and weekday names in the specified locale.
If this locale includes an encoding all strings containing month and weekday
names will be returned as unicode.

<span class="versionnote">New in version 2.5.</span>

</dl>

<p>
For simple text calendars this module provides the following functions.

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-715' xml:id='l2h-715' class="function">setfirstweekday</tt></b>(</nobr></td>
  <td><var>weekday</var>)</td></tr></table></dt>
<dd>
Sets the weekday (<code>0</code> is Monday, <code>6</code> is Sunday) to start
each week. The values <tt class="constant">MONDAY</tt>, <tt class="constant">TUESDAY</tt>,
<tt class="constant">WEDNESDAY</tt>, <tt class="constant">THURSDAY</tt>, <tt class="constant">FRIDAY</tt>,
<tt class="constant">SATURDAY</tt>, and <tt class="constant">SUNDAY</tt> are provided for
convenience. For example, to set the first weekday to Sunday:

<p>
<div class="verbatim"><pre>
import calendar
calendar.setfirstweekday(calendar.SUNDAY)
</pre></div>

<span class="versionnote">New in version 2.0.</span>

</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-716' xml:id='l2h-716' class="function">firstweekday</tt></b>(</nobr></td>
  <td><var></var>)</td></tr></table></dt>
<dd>
Returns the current setting for the weekday to start each week.

<span class="versionnote">New in version 2.0.</span>

</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-717' xml:id='l2h-717' class="function">isleap</tt></b>(</nobr></td>
  <td><var>year</var>)</td></tr></table></dt>
<dd>
Returns <tt class="constant">True</tt> if <var>year</var> is a leap year, otherwise
<tt class="constant">False</tt>.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-718' xml:id='l2h-718' class="function">leapdays</tt></b>(</nobr></td>
  <td><var>y1, y2</var>)</td></tr></table></dt>
<dd>
Returns the number of leap years in the range
[<var>y1</var>...<var>y2</var>), where <var>y1</var> and <var>y2</var> are years.

<span class="versionnote">Changed in version 2.0:
This function didn't work for ranges spanning 
                a century change in Python 1.5.2.</span>

</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-719' xml:id='l2h-719' class="function">weekday</tt></b>(</nobr></td>
  <td><var>year, month, day</var>)</td></tr></table></dt>
<dd>
Returns the day of the week (<code>0</code> is Monday) for <var>year</var>
(<code>1970</code>-...), <var>month</var> (<code>1</code>-<code>12</code>), <var>day</var>
(<code>1</code>-<code>31</code>).
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-720' xml:id='l2h-720' class="function">weekheader</tt></b>(</nobr></td>
  <td><var>n</var>)</td></tr></table></dt>
<dd>
Return a header containing abbreviated weekday names. <var>n</var> specifies
the width in characters for one weekday.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-721' xml:id='l2h-721' class="function">monthrange</tt></b>(</nobr></td>
  <td><var>year, month</var>)</td></tr></table></dt>
<dd>
Returns weekday of first day of the month and number of days in month, 
for the specified <var>year</var> and <var>month</var>.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-722' xml:id='l2h-722' class="function">monthcalendar</tt></b>(</nobr></td>
  <td><var>year, month</var>)</td></tr></table></dt>
<dd>
Returns a matrix representing a month's calendar.  Each row represents
a week; days outside of the month a represented by zeros.
Each week begins with Monday unless set by <tt class="function">setfirstweekday()</tt>.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-723' xml:id='l2h-723' class="function">prmonth</tt></b>(</nobr></td>
  <td><var>theyear, themonth</var><big>[</big><var>, w</var><big>[</big><var>, l</var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Prints a month's calendar as returned by <tt class="function">month()</tt>.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-724' xml:id='l2h-724' class="function">month</tt></b>(</nobr></td>
  <td><var>theyear, themonth</var><big>[</big><var>, w</var><big>[</big><var>, l</var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Returns a month's calendar in a multi-line string using the
<tt class="method">formatmonth</tt> of the <tt class="class">TextCalendar</tt> class.

<span class="versionnote">New in version 2.0.</span>

</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-725' xml:id='l2h-725' class="function">prcal</tt></b>(</nobr></td>
  <td><var>year</var><big>[</big><var>, w</var><big>[</big><var>, l</var><big>[</big><var>c</var><big>]</big><var></var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Prints the calendar for an entire year as returned by 
<tt class="function">calendar()</tt>.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-726' xml:id='l2h-726' class="function">calendar</tt></b>(</nobr></td>
  <td><var>year</var><big>[</big><var>, w</var><big>[</big><var>, l</var><big>[</big><var>c</var><big>]</big><var></var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Returns a 3-column calendar for an entire year as a multi-line string
using the <tt class="method">formatyear</tt> of the <tt class="class">TextCalendar</tt> class.

<span class="versionnote">New in version 2.0.</span>

</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-727' xml:id='l2h-727' class="function">timegm</tt></b>(</nobr></td>
  <td><var>tuple</var>)</td></tr></table></dt>
<dd>
An unrelated but handy function that takes a time tuple such as
returned by the <tt class="function">gmtime()</tt> function in the <tt class="module"><a href="module-time.html">time</a></tt>
module, and returns the corresponding <span class="Unix">Unix</span> timestamp value, assuming
an epoch of 1970, and the POSIX encoding.  In fact,
<tt class="function">time.gmtime()</tt> and <tt class="function">timegm()</tt> are each others' inverse.

<span class="versionnote">New in version 2.0.</span>

</dl>

<p>
The <tt class="module">calendar</tt> module exports the following data attributes:

<p>
<dl><dt><b><tt id='l2h-728' xml:id='l2h-728'>day_name</tt></b></dt>
<dd>
An array that represents the days of the week in the
current locale.
</dd></dl>

<p>
<dl><dt><b><tt id='l2h-729' xml:id='l2h-729'>day_abbr</tt></b></dt>
<dd>
An array that represents the abbreviated days of the week
in the current locale.
</dd></dl>

<p>
<dl><dt><b><tt id='l2h-730' xml:id='l2h-730'>month_name</tt></b></dt>
<dd>
An array that represents the months of the year in the
current locale.  This follows normal convention
of January being month number 1, so it has a length of 13 and 
<code>month_name[0]</code> is the empty string.
</dd></dl>

<p>
<dl><dt><b><tt id='l2h-731' xml:id='l2h-731'>month_abbr</tt></b></dt>
<dd>
An array that represents the abbreviated months of the year
in the current locale.  This follows normal convention
of January being month number 1, so it has a length of 13 and 
<code>month_abbr[0]</code> is the empty string.
</dd></dl>

<p>
<div class="seealso">
  <p class="heading">See Also:</p>

  <dl compact="compact" class="seemodule">
    <dt>Module <b><tt class="module"><a href="module-datetime.html">datetime</a></tt>:</b>
    <dd>Object-oriented interface to dates and times
                       with similar functionality to the
                       <tt class="module"><a href="module-time.html">time</a></tt> module.
  </dl>
  <dl compact="compact" class="seemodule">
    <dt>Module <b><tt class="module"><a href="module-time.html">time</a></tt>:</b>
    <dd>Low-level time related functions.
  </dl>
</div>

<div class="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="5.1.7 strftime() Behavior"
  href="strftime-behavior.html"><img src='../icons/previous.png'
  border='0' height='32'  alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="5. data Types"
  href="datatypes.html"><img src='../icons/up.png'
  border='0' height='32'  alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="5.3 collections  "
  href="module-collections.html"><img src='../icons/next.png'
  border='0' height='32'  alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
  href="contents.html"><img src='../icons/contents.png'
  border='0' height='32'  alt='Contents' width='32' /></a></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
  border='0' height='32'  alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
  href="genindex.html"><img src='../icons/index.png'
  border='0' height='32'  alt='Index' width='32' /></a></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="strftime-behavior.html">5.1.7 strftime() Behavior</a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="datatypes.html">5. Data Types</a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="module-collections.html">5.3 collections  </a>
</div>
</div>
<hr />
<span class="release-info">Release 2.5.1, documentation updated on 18th April, 2007.</span>
</div>
<!--End of Navigation Panel-->
<address>
See <i><a href="about.html">About this document...</a></i> for information on suggesting changes.
</address>
</body>
</html>
